# -*- coding: utf-8 -*-
"""
author:码同学 极光
date:2023-06-05
desc: 
sample: 
"""
name = "testfan"
#反转1
#str->list
list1 = list(name)
list1.reverse()
#list->str
print("".join(list1))
#print("".join(list(name).reverse()))

#方法2
print("方法2---")
print(reversed(name))
print("".join(reversed(name)))
#方法3  #切片

print(name[::-1])


